how to implement binary search in c